$(function () {
    findAll();
});

function findAll() {
    let data = myAjax("/back/product/findAll", '', "get");
    setData(data.list);
}

function setData(data) {
    let html = '';
    for (let i = 0; i < data.length; i++) {
        html += '<div>\n' +
            '            <div>' + data[i].id + '</div>\n' +
            '            <div>' + data[i].name + '</div>\n' +
            '            <div>' + toNullValue(data[i].normalPrice) + '</div>\n' +
            '            <div>' + (data[i].isShow == 1 ? "是" : "否") + '</div>\n' +
            '            <div>' + (data[i].isRecommend == 1 ? "是" : "否") + '</div>\n' +
            '            <div><img src="' + data[i].imgHref + '" style="width: 16px;height: 16px"></div>\n' +
            '            <div>' + data[i].cuisineName + '</div>\n' +
            // '            <div>' + toNullValue(data[i].content) + '</div>\n' +
            '            <div>' + data[i].createTime + '</div>\n' +
            '            <div>\n' +
            '                <div onclick="toEditPage(' + data[i].id + ')"><i class="iconfont icon-xxx">&#xe626;</i></div>\n' +
            '                <div onclick="del(' + data[i].id + ')"><i class="iconfont icon-xxx">&#xe624;</i></div>\n' +
            '                <div><i class="iconfont icon-xxx">&#xe61e;</i></div>\n' +
            '            </div>\n' +
            '        </div>';
    }
    $("#tBody").html(html);
}